//
//  LeftMenuViewController.m
//  YouMin_iOS
//
//  Created by lanou3g on 15/12/9.
//  Copyright © 2015年 wey. All rights reserved.
//

#import "LeftMenuViewController.h"
#import "LeftMenuCell.h"
@interface LeftMenuViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *iconView;
@property (nonatomic, strong) NSArray *titles;
@property (nonatomic, strong) NSArray *images;
@end

@implementation LeftMenuViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.tableView.backgroundColor = kRandColor;
    self.tableView.rowHeight = 60.0;
    
    [self loadData];
}

- (void)loadData {
    
    self.titles = @[@"item1",@"item2",@"item3",@"item4",@"item5"];
    self.images = @[placeHolder,placeHolder,placeHolder,placeHolder,placeHolder];
    
    self.iconView.image = [UIImage imageNamed:placeHolder];
    CGFloat radius = self.iconView.frame.size.width/2;
    self.iconView.layer.cornerRadius = radius;
    self.iconView.layer.masksToBounds = YES;
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];

}

#pragma mark --- tableView
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return self.titles.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    LeftMenuCell *cell = [tableView dequeueReusableCellWithIdentifier:@"sliderMenuCell" forIndexPath:indexPath];
    cell.iconView.image =  [UIImage imageNamed: self.images[indexPath.row]];
    cell.titleLabel.text = self.titles[indexPath.row];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    cell.backgroundColor = [UIColor clearColor];
    return cell;
}




@end
